<?php


/**
 * Description of G_WinCache
 *
 * @author Monk <eoe2005@gmail.com>
 */
if(function_exists('') === false){
    trigger_error("系统不支持wincache缓存");
    die();
}
class G_WinCache extends GC_Cache
{
    public function dec($key, $step = 1)
    {
        return wincache_ucache_dec($key,$step);
    }

    public function delete($keys)
    {
        return wincache_ucache_delete($keys);
    }

    public function exists($keys)
    {
        if(is_array($keys)){
            $rs = array();
            foreach($keys AS $k){
                if(wincache_ucache_exists($k)){
                    $rs[] = $k;
                }
            }
            return $rs;
        }else{
            return wincache_ucache_exists($keys);
        }
    }

    public function flushAll()
    {
        return wincache_ucache_clear();
    }

    public function get($key)
    {
        return wincache_ucache_get($key);
    }

    public function inc($key, $step = 1)
    {
        return wincache_ucache_inc($key,$step);
    }

    public function set($key, $val, $timeout = 0)
    {
        return wincache_ucache_set($key,$val,$timeout);
    }

}
